/*
 * @Author: Hunter
 * @Date: 2022-02-11 15:49:02
 * @LastEditTime: 2022-12-05 17:11:29
 * @LastEditors: Hunter
 * @Description: 
 * @FilePath: \book_mark_private\src\utils\index.ts
 * 可以输入预定的版权声明、个性签名、空行等
 */
export * as $utils from "utils-lib-js"
export * from './file'
export * from './html'
export * from './request'
import { App, Component } from 'vue'

/**
 * @name: 
 * @description: 新增vue插件
 * @param {App} _vm vue实例
 * @param {Component} components 组件集合
 * @return {*}
 */
export function mixinComponent(_vm: App, components?: Component) {
    for (const name in components) {
        _vm.component(name, (components as any)[name])
    }
}
/**
 * @name: 
 * @description: 取消右键事件
 * @return {*}
 */
export function cancelRightClick() {
    document.oncontextmenu = () => false;
}
/**
 * @name: 
 * @description: 取消F12按键事件
 * @return {*}
 */
export const cancelF12Click = () => document.onkeydown = (e) => e.code === 'F12' ? false : document.onkeydown?.bind(this, e)
/**
 * @name: 
 * @description: 是否是正式环境
 * @return {*}
 */
export const isProduction = () => process.env.NODE_ENV === 'production'